import request from '@/utils/request'

// 分类-获取树形分类数据
export function list() {
  return request({
    // /article/category/search
    url: '/article/category/search',
    method: 'get'
  })
}

// 分类-批量删除分类（单个删除分数调用同一接口）
export function removeByIds(categoryIds) {
  return request({
    url: '/article/category/remove',
    method: 'delete',
    data: categoryIds
  })
}

// 分类-新增
export function save(category) {
  return request({
    url: '/article/category/save',
    method: 'post',
    data: category
  })
}

// 分类-根据ID查询分类信息
export function getById(id) {
  return request({
    url: `/article/category/${id}`,
    method: 'get'
  })
}

// 分类-根据ID修改分类
export function update(category) {
  return request({
    url: '/article/category/update',
    method: 'put',
    data: category
  })
}

// 分类-修改分类顺序
export function updateSort(category) {
  return request({
    url: '/article/category/update/sort',
    method: 'put',
    data: category
  })
}

